<?php
			
	/* SVN FILE: $Id: jeditable.php 8 2011-03-13 08:32:38Z michele.andreoletti@gmail.com $ */
	
	/**
	* Project Name : arcadia
	*
	* @author $Author: michele.andreoletti@gmail.com $
	* @version $Revision: 8 $
	* @lastrevision $Date: 2011-03-13 08:32:38 +0000 (Sun, 13 Mar 2011) $
	* @filesource $URL: http://arcadia.googlecode.com/svn/trunk/sysop/jeditable.php $
	*/

	require_once '../include/functions.php';
	require_once '../include/const.inc.php';
	require_once '../include/auth.inc.php';
	require_once '../include/conn.inc.php';
	
	fnOnly4Sysop();
	
	$sQuery = "UPDATE `users` SET `".$_POST['sField']."` = '".$_POST['sValue']."' WHERE `sUsername` = '".$_POST['sUsername']."' AND  `sType` = '".$_POST['sType']."'";
	$rResult = custom_mysql_query($sQuery);
	
	fnUpdateLog("EDITED ".strtoupper($_POST['sType'])." ".$_POST['sUsername']);
	
	$sQuery = "SELECT `".$_POST['sField']."` FROM `users` WHERE `sUsername` = '".$_POST['sUsername']."' AND  `sType` = '".$_POST['sType']."'";
	$rResult = custom_mysql_query($sQuery);
	
	if (mysql_num_rows($rResult) == 1) {
		$aRow = mysql_fetch_assoc($rResult);
		
		if (!empty($aRow[$_POST['sField']])) {
			echo $aRow[$_POST['sField']];
		} else {
			echo '';
		}
		
	}
?>